package com.hzncc.flowable_diboot.contract.vo;

import com.diboot.core.binding.annotation.BindDict;
import com.diboot.core.binding.annotation.BindEntityList;
import com.diboot.core.binding.annotation.BindField;
import com.diboot.core.vo.FileVO;
import com.diboot.core.vo.LabelValue;
import com.diboot.file.entity.FileRecord;
import com.diboot.iam.entity.IamUser;
import com.hzncc.flowable_diboot.contract.entity.ContractAuditUpdate;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 合同变更 VO定义
 *
 * @author MyName
 * @version 1.0
 * @date 2024-09-06
 * Copyright © MyCorp
 */
@Getter
@Setter
@Accessors(chain = true)
public class ContractAuditUpdateListVO extends ContractAuditUpdate {
    private static final long serialVersionUID = 1544770071914353561L;
    /**
     * 发货情况 关联字典选项
     */
    @BindDict(
            type = "deliverySituation",
            field = "sendOutStatus"
    )
    private LabelValue sendOutStatusLabel;

    /**
     * 开票情况 关联字典选项
     */
    @BindDict(
            type = "invoiceSituation",
            field = "invoiceStatus"
    )
    private LabelValue invoiceStatusLabel;

    /**
     * 变更类型 关联字典选项
     */
    @BindDict(
            type = "updareType",
            field = "updateType"
    )
    private LabelValue updateTypeLabel;

    /**
     * 创建人 关联信息
     */

    @BindField(
            entity = IamUser.class,
            field = "realname",
            condition = "this.create_by = id"
    )
    private String createByLabel;

    /**
     * 更新人 关联信息
     */

    @BindField(
            entity = IamUser.class,
            field = "realname",
            condition = "this.update_by = id"
    )
    private String updateByLabel;

    @BindField(
            entity = IamUser.class,
            field = "realname",
            condition = "this.applicant = id"
    )
    private String applicantName;

    @BindDict(
            type = "contractUpdateFlag",
            field = "updateKey"
    )
    private LabelValue updateKeyLabel;

    /**
     * 暂存、提交标志位
     */
    private boolean submit;

    @BindEntityList(
            entity = FileRecord.class,
            condition = "this.auditAttachment = id",
            splitBy = ","
    )
    private List<FileVO> auditAttachmentFiles;

    /**
     * 配套机型
     */
    private String machineModel;

    /**
     * 合同签订时间
     */
    private LocalDateTime contractSignTime;

    /**
     * 客户名称
     */
    private String customerName;

    /**
     * 合同执行情况
     */
    private String execStatus;

    /**
     * 订购型号
     */
    private String orderModel;

    /**
     * 销售员
     */
    private String salesperson;

    /**
     * 合同类型
     */
    private String contractType;

}